class Router extends egret.DisplayObjectContainer {
    public constructor() {
        super()
        this.once(egret.Event.ADDED_TO_STAGE, this.init, this)
    }
    private init() {
        // 添加星星
        const star = Utils.createBitmapByName('star_1_png')
        this.addChild(star)
        egret.Tween.get(star, { loop: true })
            .to({ alpha: 0 }, 800)
            .call(() => {
                star.texture = RES.getRes('star_2_png')
            })
            .to({ alpha: 1 }, 800)
            .to({ alpha: 0 }, 800)
            .call(() => {
                star.texture = RES.getRes('star_3_png')
            })
            .to({ alpha: 1 }, 800)
            .to({ alpha: 0 }, 800)
            .call(() => {
                star.texture = RES.getRes('star_1_png')
            })
            .to({ alpha: 1 }, 800)

        const screenUpload = new ScreenUpload()
        this.addChild(screenUpload)

        screenUpload.addEventListener('next', () => {
            const screenOver = new ScreenOver()
            this.removeChild(screenUpload)
            this.addChild(screenOver)
        }, this)

        this.addChild(new Music())
        
    }


}